//
//  ARYKeyChainEX.m
//  aryshinKit
//
//  Created by 0-0 on 2017/5/18.
//  Copyright © 2017年 aryshin2016@hotmail.com. All rights reserved.
//

#import "ARYKeyChainEX.h"
#import <objc/message.h>

@implementation ARYKeyChainEX

+ (id)readKeyChainWithIdenty:(id)identy{
    id dt = nil;
    Class cls = NSClassFromString(@"ARYKeyChain");
    if (cls ==nil) {
        NSLog(@"ARYKeyChain 类加载失败！！！！！");
        return dt;
    }else{
        SEL selector = NSSelectorFromString(@"loadFromKeyChain:");
        
        if ([cls respondsToSelector:selector]) {
          dt = objc_msgSend(cls, selector, identy);
        }
        return dt;
    }
    
}
    
+(void)saveKeyChainWithIdenty:(id)bundleid data:(id)data{
    id result = nil;
    Class cls = NSClassFromString(@"ARYKeyChain");
    if (cls ==nil) {
        NSLog(@"ARYKeyChain 类加载失败！！！！！");
        return;
    }
        
    SEL selector = NSSelectorFromString(@"saveToKeyChain:data:");
    
    if ([cls respondsToSelector:selector]) {
      result = objc_msgSend(cls, selector, bundleid, data);
        NSLog(@"selector=%@;result:%@",NSStringFromSelector(selector), result);
    }
    
}
    
@end
